package com.spring.authManage.dao;

import java.util.List;

import com.spring.authManage.pojo.ResourceInfo;
import com.spring.authManage.pojo.ResourceInfoParam;
import com.spring.authManage.pojo.UserInfo;

public interface ResourceInfoDao {
	
	/**
	 * 添加资源
	 * @param resourceInfo
	 * @return
	 */
	public void addResource(ResourceInfo resourceInfo) throws Exception;
	/**
	 * 更改资源信息
	 * @param resourceInfo
	 * @return
	 */
	public void updateResource(ResourceInfo resourceInfo) throws Exception;
	/**
	 * 作废资源
	 * @param resourceInfo
	 * @return
	 */
	public void deleteResource(String res_id) throws Exception;
	/**
	 * 重启资源
	 * @param resourceInfo
	 * @return
	 */
	public void restartResourceInfo(String res_id) throws Exception;
	/**
	 * 查询是否已存在相同资源
	 * @param resourceInfo
	 * @return
	 */
	public Integer existResource(ResourceInfo resourceInfo) throws Exception;
	/**
	 * 计算分页
	 * @param resourceInfo
	 * @return
	 */
	public Integer countResourceByParam(ResourceInfoParam resourceInfoParam) throws Exception;
	/**
	 * 根据条件查询资源
	 * @param resourceInfo
	 * @return
	 */
	public List<ResourceInfo> queryResourceByParam(ResourceInfoParam resourceInfoParam) throws Exception;
	/**
	 * 进去资源管理页面初始查询所有一级菜单
	 * 
	 * @return
	 */
	public List<ResourceInfo> queryFirstLevel(ResourceInfoParam param) throws Exception;
	/**
	 * 点击一级菜单查询附属二级菜单详细
	 * @param id
	 * @return
	 */
	public List<ResourceInfo> querySecondLevel(String id) throws Exception;
	/**
	 * 查询所有父资源name,id
	 * @param id
	 * @return
	 */
	public List<ResourceInfo> queryParentResource() throws Exception;
	/**
	 * 根据父资源name查询id
	 * @param id
	 * @return
	 */
	public List<ResourceInfo> getParentId(String id) throws Exception;
	/**
	 * 获取所有可用的资源
	 * @return
	 */
	public List<ResourceInfo> getAllEnabledResource() throws Exception;
	/**
	 * 根据角色获取该角色拥有的权限
	 * @param roleId
	 * @return
	 */
	public List<ResourceInfo> getResourceByRole(String roleId) throws Exception;
	/**
	 * 根据用户获取用户所拥有的权限
	 * @param userId
	 * @return
	 */
	public List<ResourceInfo> getResourceByUser(String userId) throws Exception;
	/**
	 * 根据ID获取权限具体信息
	 * @param id
	 * @return
	 */
	public ResourceInfo queryResourceById(String id) throws Exception;
	/**
	 * 根据用户名获取一级菜单二级菜单
	 * @param userName
	 * @return List<String>
	 */
	public List<ResourceInfo> getFirstTextByUserName(String userName) throws Exception;
	
	/**
	 * 动态生成菜单
	 * @param param
	 * @return
	 */
	public List<ResourceInfo> getMenuByUserName(String userName) throws Exception;
	
}
